<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<body>
<h1>jianglai BBS</h1><br/>
<a href="/login/index.do">首页</a>
<c:if test="${user != null}">
    ${user.nickName}  <a href="/login/logout.do">登出</a>
</c:if>
<c:if test="${user == null}">
    <a href="/login/loginPage.do">登录</a>&nbsp;
    <a href="/login/registPage.do">注册</a>
</c:if>
    <h2>${category.name}</h2>
    <form action="/post/add.do" method="post">
        <input type="hidden" name="categoryId" value = "${category.id}"/>
        <input type="hidden" name="pid" value="0"/>
        <input type="hidden" name="level" value="1"/>
        <input type="hidden" name="userId" value="${user.id}"/>
    <p>
        标题<input type="text" name="title"/><br/>
        内容<textarea name="content"></textarea><br/>
    </p>
        <input type="submit" value="提交"/>
    </form>
</body>
</html>
